<!--
SPDX-License-Identifier: Apache-2.0
Copyright (c) 2020 Intel Corporation
-->

{%- assign pageName = page.path | split: "/"  -%}

{%- if pageName[1] -%}
{%- assign pageName = pageName[1] | prepend: "/" | append: "/" | replace: ".md","" -%}
{%- else -%}
{%- assign pageName = pageName[0] | prepend: "/" | append: "/" | replace: ".md","" -%}
{%- endif -%}

{%- assign navigations = "" | split:"|" -%}
{%- for navbars_data in site.data.navbars -%}
  {%- assign nav = navbars_data[1] -%}
  {%- assign navigations = navigations | push: nav -%}
  {%- if pageName == nav.path -%}
    {% assign this_pages_navbar = nav %}
    {%- else -%}
    {% assign not_this_page = nav %}
  {%- endif -%}
{%- endfor -%}
{%- assign navbars = navigations | sort:"order" -%}

{%- assign title = page.name | replace: "-"," " | replace: "_"," " | split: ".md" | first -%}
{%- assign pageTitle = title | split: ' ' -%}
{%- capture pageTitleUpper -%}{%- for word in pageTitle -%}{{ word | capitalize }} {%- endfor -%}{%- endcapture -%}
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <style>.rightSection #contentArea img { max-width: none; width: 100% }</style>
      <div class="rightSection">
        <div class="rightHead" style="display: none;">
          <div class="breadcrumbList pull-left">
            <a href="{{ site.baseurl | append: "/" }}" class="noCrossRef productSubtitle"> Home </a>
            {%- if pageTitleUpper != 'index.html' -%}
                {%- for navbar in navbars -%}
                    {%- include breadcrumbs.html section=navbar.section -%}
                {%- endfor -%}
            {%- endif -%}
          </div>
          <div class="editLink pull-right">
            <a data-proofer-ignore href="https://github.com/open-ness/specs/blob/master/{{page.path}}" rel="nofollow" class="edit-page-link" target="_blank">
                <i class="fa fa-github" aria-hidden="true"></i>
                Edit this page
            </a>
          </div>  
            
        </div>
        <div class="clearfix"></div>
        
        <div class="download-strip" style="display: none;">
            <div class="read-time pull-left">
                <i class="fa fa-clock-o" aria-hidden="true"></i>
                {% include reading-time.html %}
            </div>
                {% if page.name != 'index.html' %}
                    <div class="download-pdf pull-right">
                        <a href="javascript:void(0)" class="download_page">
                            <i class="fa fa-file-pdf-o" aria-hidden="true"></i>
                            Download this page
                        </a>
                    </div>
                {% endif %}
        </div> 
        
        <div class="contentArea" id="contentArea">
            {{ content }}
        </div>
      </div>
